package com.shejimoshi.单例模式.单例模式的安全性.序列化攻击;

import java.io.*;

/**
 * 需要序列化的类必须实现java.io.Serializable接口，否则会抛出NotSerializableException异常
 */
public class Singleton implements Serializable {
    private static final long serialVersionUID = 8656128222714547171L;

    private final static Singleton singleton = new Singleton();

    private Singleton(){};

    public static Singleton getInstance() {
        return singleton;
    }
}
